define(["jquery", "easy-admin"], function ($, ea) {
    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'registration_record/index',
        add_url: 'registration_record/add',
        edit_url: 'registration_record/edit',
        delete_url: 'registration_record/delete',
        export_url: 'registration_record/export',
        modify_url: 'registration_record/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {field: 'position_name', title: '职位名称'},
                    {field: 'name', title: '用户姓名', search: false},
                    {field: 'gender', minWidth: 80, title: '性别',selectList: {0: '未知',1: '男',2: '女'}, search: false},
                    {field: 'age', title: '年龄', search: false},
                    {field: 'mobile', title: '联系电话', search: false},
                    {field: 'contact_type', minWidth: 80, title: '联系类型',selectList: {1: '手机',2: 'QQ',3: '微信'}},
                    {field: 'registration_method', title: '报名方式', search: false},
                    {field: 'qrcode', minWidth: 80, title: '二维码', search: false, templet: ea.table.image}, 
                    {field: 'created_at', title: '报名时间', search: false},
              
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});